package org.esky;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

public class T6_Server {
	public static void main(String[] args) {
		try {
			ServerSocket serverSocket = new ServerSocket(1111);
			System.out.println("服务器启动！");
			Socket socket = serverSocket.accept();
			InputStream is = socket.getInputStream();
			BufferedReader br = new BufferedReader(new InputStreamReader(is));
			while (true) {
				String info = br.readLine();
				if (info != null) {
					if (info.equals("end")) {
						break;
					}
					System.out.println("info: " + info);
				}
			}
		} catch (IOException e) {
			System.out.println("结束");
		}
	}
}
